#ifndef TL_GROUP_H
#define TL_GROUP_H

#include <stdio.h>

#ifdef JMBC_INSIDE

typedef struct
{
	void *array;
	unsigned int length;
	unsigned int size;
} TLGroup;

#endif


// Context

void
tlGroupCreateContext(void);

// Generation / Deletion

void
tlGenGroups(unsigned int n, unsigned int *groups);

void
tlDeleteGroups(unsigned int n, unsigned int *groups);

// Load / Unload

void
tlGroupAllocate(unsigned int id, unsigned int n, unsigned int size);

void
tlGroupSet(unsigned int id, void *array, unsigned int length);

void
tlGroupUnload(unsigned int id);

void
tlGroupsUnload(unsigned int n, unsigned int *groups);

// Query

void *
tlGroupArray(unsigned int id);

unsigned int
tlGroupLength(unsigned int id);

// Disk I/O

void
tlGroupRead(unsigned int id, unsigned int n, unsigned int size, FILE *stream);

void
tlGroupWrite(unsigned int id, FILE *stream);

#endif
